<style lang="scss" scoped>
    @import '../../css/training.scss';
    .hide{display: none;}
    .active{color: $mco;border-bottom:3px solid #3F66F6;}

    /*编辑问卷状态下----编辑问卷*/
    .text-input-a{width: 100%;height: 48px;border: 1px solid $mc3;background: #fff;text-align: center;line-height: 48px;box-sizing: border-box;}
    .editor-limit-txt{color:$mc3;right: 20px;bottom:30px;}

    .naire-bottom-dealr{ height:42px;line-height: 42px;}
    /*编辑状态下生成问卷---*/
    .naire-creat-des{border-top:1px  solid #e1e7eb;border-bottom: 1px  solid #e1e7eb;padding:20px 0px;width: 100%;color:$mc2;font-size: 14px;line-height: 30px;}
    .text-input-b{width: 100%;height:50px;background: #fff;text-align: center;line-height: 50px;border:none;}
    .public-btn-icon{top: 38px;right:0px;position: absolute;margin-left: 20px;}

    /*添加按钮*/
    .question-types-btn{cursor: pointer;}
    .deal-btn{cursor: pointer;}

    /*题目循环*/
    .ques-tit{font-size: 14px;color:red;}
    .edit-icon{width: 40px; height: 40px; float: right; cursor: pointer; background: #f7f8fa url('http://jhsy-img.caizhu.com/sass/images/icon-edit.png') no-repeat center center;}
    .save-icon{width: 40px; height: 40px; float: right; cursor: pointer; background: #f7f8fa url('../../images/save-ic.png') no-repeat center center;}
    /*展示状态下*/
    /*编辑状态下*/
    .btn-cancel{background: $mc3;color:#fff;}
    .choose-btn{width: 410px; text-align: center; border: $mcbd dashed 1px; color: $mc2; line-height: 40px; cursor: pointer;}

</style>

<template>
    <section>

        <section class="breadcrumb-box clearfix">
            <el-breadcrumb separator=" > " class="fl">
                <el-breadcrumb-item >培训</el-breadcrumb-item>
                <el-breadcrumb-item :to="{path: '/training/training-manage'}">培训管理</el-breadcrumb-item>
                <el-breadcrumb-item v-if="$route.meta">{{$route.meta.title}}</el-breadcrumb-item>
            </el-breadcrumb>
        </section>

        <section class="questionnaire-box mt">
            <section class="train-name">
                <span>《多麦企业文化培训》问卷</span>
                <!-- <el-input v-model="QNRForm.TrainName" placeholder="请输入培训名称"></el-input>  -->
            </section>

            <section class="traniing-info-tab exam-info-tab p-relative">
                <span v-for="item,$index in tabList" :class="{'active': tabIndex ==$index}" @click="tabActive($index)">{{item}}</span>
                <div class="p-absolute exam-info-tabr">
                    <span class="mr20">预览</span>
                    <span class="ml from-bank">+  从题库选题</span>
                </div>
            </section>

            <!--主要内容-->
            <section class="naire-main-content">

                <!--没有编辑状态下---空白页-->
                <section v-if="spaceQNRFlag == true" class="exam-space">
                    <span class="exam-space-item space-iconf" @click="setNewQuestionnaire">
                        <img src="../../images/Training-ic-paper.png" alt="">
                        <span class="space-txt fs-14 mt">新建空白问卷</span>
                    </span>
                    <div class="exam-space-item" @click="questionnaireChoose = true">
                        <img src="../../images/Training-ic-Test-paper.png" alt="">
                        <span class="space-txt fs-14 mt">问卷库中选择</span>
                    </div>
                </section>

                <!--不显示空白页-->
                <section v-if="spaceQNRFlag == false">

                    <!--编辑问卷-->
                    <section v-if="step==0">
                        <el-form  :model="QNRForm" :rules="QNRrules" ref="QNRForm"  label-width="200px">

                            <div  class="mt20">   <!--:class="{'hide':!paperFlag}"-->
                                <section >    <!--v-if="!QNRCreate" -->

                                    <!--问卷编辑状态-->
                                    <el-form-item label="问卷名称" prop="ExamTitle">
                                        <el-input placeholder="请输入问卷名称" v-if="QNRCreate == false" v-model="QNRForm.ExamTitle"></el-input>
                                        <el-input placeholder="请输入问卷名称" v-if="QNRCreate == true" v-model="QNRForm.ExamTitle" :disabled="QNRTitle.paperFlag == false" @focus="QNRTitleFocus"></el-input>
                                        <template v-if="QNRCreate == true"><!--问卷显示状态--> <!-- 显示问卷头部信息 -->    <!-- v-if="paperFlag == true" -->
                                            <span class="edit-icon" v-if="QNRTitle.paperFlag == false" @click="QNRTitle.paperFlag=true"></span>
                                            <span class="save-icon" v-if="QNRTitle.paperFlag == true" @click="doSaveQNRTitle"></span>
                                        </template>
                                    </el-form-item>
                                    <el-form-item label="问卷描述" prop="ExamDesc">
                                        <el-input placeholder="请输入问卷描述" v-if="QNRCreate == false" v-model="QNRForm.ExamDesc"></el-input>
                                        <el-input placeholder="请输入问卷描述" v-if="QNRCreate == true" v-model="QNRForm.ExamDesc" :disabled="QNRDes.paperFlag == false"  @focus="QNRDesFocus"></el-input>
                                        <template v-if="QNRCreate == true"><!--问卷显示状态--> <!-- 显示问卷头部信息 -->    <!-- v-if="paperFlag == true" -->
                                            <span class="edit-icon" v-if="QNRDes.paperFlag == false" @click="QNRDes.paperFlag=true"></span>
                                            <span class="save-icon" v-if="QNRDes.paperFlag == true" @click="doSaveQNRDes"></span>
                                        </template>
                                    </el-form-item>



                                    <section class="mt40 naire-bottom-deal">

                                        <!--初始化题目添加-->
                                        <!--按钮展开-->
                                        <span class="question-types-btn mr" @click="addEventRadio(2)">
                                            <img src="../../images/Training-ic-increase.png" alt="">
                                            <span class="fs-14">单选题</span>
                                        </span>
                                        <span class="question-types-btn mr"  @click="addEventMulti(1)">
                                            <img src="../../images/Training-ic-increase.png" alt="">
                                            <span class="fs-14">多选题</span>
                                        </span>
                                        <span class="question-types-btn" @click="addEventSubItem(3)">
                                            <img src="../../images/Training-ic-increase.png" alt="">
                                            <span class="fs-14">问答题</span>
                                        </span>

                                        <!--保存到问卷库&保存到题库-->
                                        <section class="fr naire-bottom-dealr">
                                            <section class="p-relative fl" style="padding-right:20px;">
                                                <el-checkbox v-model="checked1">将试卷保存到问卷库</el-checkbox>
                                                <img class="question_ic p-absolute" src="../../images/question_ic.png" alt="">
                                            </section>
                                            <section class="fl">
                                                <el-checkbox v-model="checked2" class="ml20">将试卷保存到题库</el-checkbox>
                                            </section>
                                        </section>

                                    </section>

                                    <!--开始题目循环--><!-- 1 多选  2 单选  3 问答 v-if="qsnQuestionFlag == true"  v-for="out,$index in QNRForm.Questions"-->
                                    <div class="clearfix" v-for="out,outIndex in QNRForm.Questions">

                                        <!--左侧操作按钮-->
                                        <div class="ac-left-tab fl" v-if="">
                                            <span class="">Q1</span>
                                            <span class=" deal-btn" @click="doOutTop"><img class="public-icon" src="../../images/compile_ic.png" alt=""></span>
                                            <span class=" deal-btn"><img class="public-icon" src="../../images/Training-ic-down.png" alt=""></span>
                                            <span class=" deal-btn"><img class="public-icon" src="../../images/delete_ic.png" alt=""></span>
                                        </div>

                                        <!--右侧-->
                                        <div class="ac-right-table">

                                            <!--题目+分数值-->
                                            <div class="ac-table-title mt20">
                                                <!--显示状态-->
                                                <template v-if="QNRCreate == true">
                                                    <section v-if="qsnQuestionFlag == false" class="mt20">  <!--1是，0否，默认1 -->
                                                        <p class="mt20 ques-tit">
                                                            问卷题目一
                                                            <span class="ml20" v-if="out.IsNeed == 1">【必答】</span>
                                                            <span class="ml20" v-if="out.IsNeed == 0"></span>
                                                        </p>
                                                    </section>
                                                </template>
                                                <!--编辑状态-->
                                                <template v-if="QNRCreate == false">
                                                    <div v-if="qsnQuestionFlag == true">
                                                        <input class="input-type-a fs-14" type="text" placeholder="请输入题目名称">
                                                        <span class="fs-14 ml20" style="line-height: 42px;">【单选题】</span>
                                                    </div>
                                                </template>
                                            </div> <!--题目+分数值结束-->

                                            <!--内容-->
                                            <div v-for="item,inIndex in out.Answers">

                                                <!--一个选项--> <!--显示-->
                                                <template v-if="QNRCreate == true">
                                                    <template v-if="qsnChoiceFlag == false"><!--提交之后展示-->
                                                        <template v-if="out.QuestionType == 2"> <!--单选-->
                                                            <template>
                                                                <el-radio-group v-model="out.checkIndex">
                                                                    <el-radio :label="inIndex" :disabled="qsnChoiceFlag == false">{{answerArr[inIndex]}}</el-radio>
                                                                </el-radio-group>
                                                            </template>
                                                        </template>
                                                        <template v-if="out.QuestionType == 1"> <!--多选-->

                                                        </template>
                                                        <template v-if="out.QuestionType == 3"> <!--问答-->

                                                        </template>
                                                    </template><!--提交之后展示结束-->
                                                    <template v-if="qsnChoiceFlag == true"> <!--提交之后修改-->
                                                        <template v-if="out.QuestionType == 2"> <!--单选-->

                                                        </template>
                                                        <template v-if="out.QuestionType == 1"> <!--多选-->

                                                        </template>
                                                        <template v-if="out.QuestionType == 3"> <!--问答-->

                                                        </template>
                                                    </template><!--提交之后修改结束-->
                                                </template> <!--一个选项--> <!--显示结束-->
                                                <!--一个选项--> <!--编辑-->
                                                <template v-if="QNRCreate == false"><!--编辑状态下-->
                                                    <template v-if="qsnChoiceFlag == true"> <!--编辑选项-->
                                                        <template v-if="out.QuestionType == 2"> <!--单选-->

                                                        </template>
                                                        <template v-if="out.QuestionType == 1"> <!--多选-->

                                                        </template>
                                                        <template v-if="out.QuestionType == 3"> <!--问答-->

                                                        </template>
                                                    </template><!--编辑选项结束-->
                                                    <template v-if="qsnChoiceFlag == false"> <!--保存选项-->
                                                        <template v-if="out.QuestionType == 2"> <!--单选-->

                                                        </template>
                                                        <template v-if="out.QuestionType == 1"> <!--多选-->

                                                        </template>
                                                        <template v-if="out.QuestionType == 3"> <!--问答-->

                                                        </template>
                                                    </template><!--保存选项结束-->
                                                </template><!--一个选项--> <!--编辑结束-->

                                                <template v-if="QNRCreate == false">
                                                    <template v-if="qsnQuestionFlag == true">
                                                        <el-button class="btn-or btn-active">保存</el-button>
                                                        <el-button class="btn-or btn-cancel">取消</el-button>
                                                    </template>
                                                </template>
                                                <template v-if="QNRCreate == false">
                                                    <div class="choose-btn" @click="">+添加选项</div>
                                                </template>
                                            </div><!--内容结束-->

                                        </div>  <!--右侧结束-->

                                    </div>



                                    <!--生成问卷-->
                                    <section class="mt40" style="width: 100%;text-align: center;">
                                        <el-button class="btn-active btn-or" @click="toBecomeQuestionnaire">生成问卷</el-button>
                                    </section>

                                </section>
                            </div>
                        </el-form>

                        <!--发放问卷-->
                        <section v-if="step==1">
                            2222
                        </section>

                        <!--问卷结果-->
                        <section v-if="step==2">
                            33343333
                        </section>

                    </section>

                </section>

            </section>

            <!--从问卷库中选择问卷-->
            <el-dialog
                    title="问卷选择"
                    :visible.sync="questionnaireChoose"
                    width="50%"
                    center>
                <section class="signup-total">
                    <el-input
                            placeholder="请输入内容"
                            prefix-icon="el-icon-search"
                            v-model="libQNRKeyword"
                            class="sign-input">
                    </el-input>
                </section>
                <section class="table-box mt">
                    <el-table :data="libQRNList" height="300">
                        <el-table-column property="ExamTitle" label="问卷名称" style="text-align: center;"></el-table-column>
                        <el-table-column property="QuestionNum" label="问卷题目数"></el-table-column>
                        <el-table-column property="CreateTime" label="创建时间"></el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="one">
                                <el-button type="text" size="small" @click="libQRNApplay(one.row)">应用</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </section>
                <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="questionnaireChoose = false">知道了</el-button>
            </span>
            </el-dialog>

            <!--生成问卷中点击删除-->



        </section>

    </section>
</template>

<script>

	import qs from 'qs'
	import editor from '../../components/wangeditor.vue'
	let answerArr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'G', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
	export default{
		data: function(){
			return {
				tabIndex: 0,
				tabList:['编辑问卷','发放问卷','问卷结果'],
				questionnaireType: 0,//问卷tab切换

				initHasNaire: false,

				step:0,

//                编辑问卷--新建空白问卷

				showTopicTypesBtn: false,  //显示题目类型按钮
				showTopicSingleBtn: true,  //显示添加题目按钮
				checked1: true,  //默认选中-将试卷保存到试卷库
				checked2: false,
//                点击生成问卷

				QNRCreate:false,  //未点击生成问卷状态（是否提交 ）

				editText:false,  //未编辑状态
				naireName:'试卷标题111',
				newNaireName:'',
				questionnaire:{
					theme:''
				},

//              从问卷库中选择问卷
				questionnaireChoose: false,

// 2018 1-6
				libQNRKeyword: '', // 弹窗从问卷库选择 搜索字段---libQNRKeyword
				libQRNList:[],     // 问卷库列表

				pageLibQRNInfo:{  // 请求问卷库 问卷详情
					page:'',
					pageSize:'',
				},
				paperFlag: '', // false 无编辑（问卷展示）true 编辑问卷

				initHasQsn: '', // 0 无问卷 1 有问卷
//				无试卷-------
				spaceQNRFlag: '',  // true 显示空白页 false 不显示空白页
//				一套卷子------------
				paperFlag: '',  //
//				一道题目--------
				qsnQuestionFlag: '',  //  true 编辑状态  false  展示状态
//				一个选项--------
				qsnChoiceFlag: '',

				answerArr: answerArr,
				QNRForm:{
					ExamTitle:"",
					ExamDesc:"",
					Questions:[
						{
							ExamQID:"",
							QuestionType:"",
							QuestionTitle:"",
							IsNeed:"",
							SortNum:"",
							LimitAnswerNum:"",
							checkIndex:'',// 单个数字或者字符串 arr.push(indexs)
							Answers:[
								{
									AnswerID:"",
									AnswerKey:"",
									AnswerValue:"",
									SortNum:""
								},
							]
						},
					]
				},

//                规则
				QNRrules:{
					ExamTitle: [
						{ required: true, message: '请输入问卷名称', trigger: 'blur' }
					],
					ExamDesc: [
						{ required: true, message: '请输入问卷描述', trigger: 'blur' }
					],
				},

				addBtnFlag: '', // 是否显示添加题目一个按钮
//                展示状态下修改----
				QNRTitle:{
					paperFlag: false, // 问卷标题编辑状态
				},
				QNRDes:{
					paperFlag: false, // 问卷描述编辑状态
				},

				QNRExamLibID:'',//  判断-----新创建的问卷  PK   问卷库问卷(应用时获取问卷id)


			}
		},
		mixins: [mixinMethods],
		methods: {
			HasQSN(){  // 初始判断
				let self =this;
				//        是否有问卷 有问卷----问卷展示-----无问卷----新建问卷
				var ExamQNRID = self.$route.query.ExamQNRID;
				self.QNRForm.ExamQNRID = ExamQNRID;
				console.log('问卷id');
				console.log(self.QNRForm.ExamQNRID);
				if(ExamQNRID == undefined){;console.log(111);
					self.step = 0;
					self.initHasQsn = 0;  // 无问卷
					self.spaceQNRFlag = true;
				}else if(ExamQNRID == 0){console.log(222)
					self.initHasQsn = 0;  // 无问卷
					self.step = 0;
					self.spaceQNRFlag = true;
				}else if(ExamQNRID > 0){console.log(333)
					self.initHasQsn = true; // 有问卷----展示问卷
					console.log('22222222222222222');
//					self.step = 2;
					console.log(this.initHasQsn+' : '+ self.step);  // 如果有问卷-----请求接口------------

					self.spaceQNRFlag = false;  // 不显示空白页
					self.QNRCreate = true;

					self.getTrainQNRInfo(ExamQNRID);
					self.getQNRbankInfo(ExamQNRID);  // 获取问卷详情（应用的时候）
					//location.assign('/training/push-paper'+'?ExamID='+this.form.ExamID); // 先另跳转页面---后来合并后可以删掉

					return true;
				}else{
					return false;
				}
			},

			tabActive(i){//显示tab

				let self = this;
				self.tabIndex = i;
				self.step = i;
			},
			setNewQuestionnaire(){//新建空白问卷
				let self = this;
				self.spaceQNRFlag = false;  //
				self.step = 0;
				self.paperFlag = true;
			},
			actionBtn(){
				let self = this;
				self.showTopicTypesBtn = true;
				self.showTopicSingleBtn = false;
			},
			offBtn(){
				let self = this;
				self.showTopicTypesBtn = false;
				self.showTopicSingleBtn = true;
			},
			toBecomeQuestionnaire(){//点击生成问卷按钮
				this.$refs.QNRForm.validate((valid) => {  //所有的输入框验证
					if (valid) {
						alert('编辑成功!');
						this.QNRCreate = true;
					} else {
						this.$message.error('请填写完整再进行操作哦');
						return false;
					}
				});

			},
			editTextIcon(){//点击修改图标状态
				this.editText = true;
			},
			editTextIconSave(){
				this.editText = false;
				this.naireName = this.newNaireName;
			},
			doDelete(){//在生成试卷后--删除问卷试题
				this.$confirm('删除数据不可恢复，请再次确认是否要删除。', '您确定要删除该问题吗？', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning',
					center: true
				}).then(() => {
					this.$message({
						type: 'success',
						message: '删除成功!'
					});
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
			},



//  2018-1-6


//          获取问卷库列表
			getQNRLibList(){

				axios.post('/com/exam/getQNRLibList', qs.stringify({
//					pagesize:this.pageLibQRNInfo.pageSize,
//					page:this.pageLibQRNInfo.page,
//					keywords: this.libQNRKeyword,

				})).then( (res) => {
					var d = res.data;
					if(d.flag == 1){
						console.log(d);
						this.libQRNList = d.data.Rows;
						console.log('问卷库列表');
						console.log(this.libQRNList);

					}else{
						this.$message.error(d.msg);
					}
				} );
			},

			libQRNApplay(a){  // 将问卷库中问卷---应用
				let self = this;
				let ExamLibID = a.ExamLibID;
				this.QNRExamLibID = a.ExamLibID;  // 问卷库问卷
//                获取问卷库问卷详情
				this.getQNRbankInfo(ExamLibID);
			},


			getQNRbankInfo(id){  // 获取问卷库问卷详情
				let self = this;
				let ExamLibID = id;

				axios.post('/com/exam/getQNRLib', qs.stringify({
					examLibID: ExamLibID,
				})).then( (res) => {
					var d = res.data;

					this.questionnaireChoose = false;  // 问卷库弹框
					this.spaceQNRFlag = false;  // 空白页

					if(d.flag == 1){
						console.log('获取问卷库问卷详情');
						console.log(d);

//                        赋值
						this.QNRForm = d.data;
						console.log(this.QNRForm.Questions[0].IsNeed)

						self.paperFlag = false; // 整个卷子展示状态-----可不加
						console.log('我是我是是战士之昂')
						self.QNRCreate = true;
						self.qsnQuestionFlag = false;
						self.qsnChoiceFlag = false;
					}else{
						this.$message.error(d.msg);
					}
				} );

			},

			getTrainQNRInfo(id){  //获取培训问卷详情
				axios.post('/com/exam/getQNR', qs.stringify({
					/*ExamLibID:id,*/
					examID: id,
				})).then( (res) => {
					var d = res.data;
					if(d.flag == 1){
						console.log('获取培训问卷详情');
						console.log(d);

					}else{
						this.$message.error(d.msg);
					}
				} );

			},

//            没有问卷--  新建问卷

//      问卷展示状态
			doSaveQNRTitle(){  // 编辑问卷头部标题
				let ExamID1 = this.$route.query.ExamQNRID;  // 问卷id
				let ExamID2 = this.QNRExamLibID;  // 应用的时候获取到的;
				console.log('问卷命苦'+ ExamID2);

//               判断的目的----获取id
				if(ExamID1 > 0){  // 编辑新创建的标题
					axios.post('/com/exam/editQNR', qs.stringify({
						examID: ExamID1,
						examTitle: this.QNRForm.ExamTitle,
					})).then( (res) => {
						var d = res.data;
						if(d.flag == 1){
							console.log('新创建的问卷详情');
							console.log(d);
							this.$message.success('编辑成功');
							this.QNRTitle.paperFlag = false;
						}else{
							this.QNRTitle.paperFlag = false;
							this.$message.error(d.msg);
						}
					} );

				}else if(ExamID1 == 0){  // 得到了问卷库问卷的 id
//                    细分两种状态----新建是ExamID1 == 0（没有id,不用请求）  应用则是ExamID1 == 0  ExamID2 > 0
					if(ExamID2 > 0){
						axios.post('/com/exam/editQNR', qs.stringify({
							examID: ExamID2,  // 问卷库中的id
							examTitle: this.QNRForm.ExamTitle,
						})).then( (res) => {
							var d = res.data;
							if(d.flag == 1){
								console.log('问卷库问卷详情');
								console.log(d);
								this.$message.success('编辑成功');
								this.QNRTitle.paperFlag = false;
							}else{
								this.QNRTitle.paperFlag = false;
								this.$message.error(d.msg);
							}
						} );
					}else if(ExamID2 <=0){
						this.$message.error('没有问卷id');
					}

				}

			},

			doSaveQNRDes(){  // 保存描述

				let ExamID1 = this.$route.query.ExamQNRID;  // 问卷id（路由获取） 获取id方式
				let ExamID2 = this.QNRExamLibID;  // 应用的时候获取到的;
				console.log('问卷命苦'+ ExamID2);

//               判断的目的----获取id
				if(ExamID1 > 0){  // 编辑新创建的标题------可能不需要判断
					axios.post('/com/exam/editQNR', qs.stringify({
						examID: ExamID1,
						examDesc: this.QNRForm.ExamDesc,
					})).then( (res) => {
						var d = res.data;
						if(d.flag == 1){
							console.log('新创建的问卷详情');
							console.log(d);
							this.$message.success('编辑成功');
							this.QNRDes.paperFlag = false;
						}else{
							this.QNRDes.paperFlag = false;
							this.$message.error(d.msg);
						}
					} );

				}else if(ExamID1 == 0){  // 得到了问卷库问卷的 id
//                    细分两种状态----新建是ExamID1 == 0（没有id,不用请求）  应用则是ExamID1 == 0  ExamID2 > 0
					if(ExamID2 > 0){
						axios.post('/com/exam/editQNR', qs.stringify({
							examID: ExamID2,  // 问卷库中的id
							examDesc: this.QNRForm.ExamDesc,
						})).then( (res) => {
							var d = res.data;
							if(d.flag == 1){
								console.log('问卷库问卷详情');
								console.log(d);
								this.$message.success('编辑成功');
								this.QNRDes.paperFlag = false;
							}else{
								this.QNRDes.paperFlag = false;
								this.$message.error(d.msg);
							}
						} );
					}else if(ExamID2 <=0){
						this.$message.error('没有问卷id');
					}

				}

			},

			QNRTitleFocus(){  //  问卷标题编辑聚焦()
				this.QNRTitle.paperFlag = true;
			},
			QNRDesFocus(){  // 问卷描述编辑聚焦
				this.QNRDes.paperFlag = true;
			},

//
//            添加问卷题目
			addEventRadio(a,flag){  // 添加单选题
				let self = this;
				if(flag){
					self.addBtnFlag = true;
				}
				let type = a;
				console.log(type);
//
				self.qsnQuestionFlag = true;  // 题目编辑为true
				self.qsnChoiceFlag = true;  // 选项编辑为true

			},

//            点击添加多选题





		},
		mounted: function(){
//			this.spaceQNRFlag = true;

//            2018-1-6
			this.getQNRLibList();
			this.HasQSN();
		},
		components: {
			editor: editor
		}
	}


</script>